const app = getApp()
Page({
    isBegin: true,
        questionList: [
            {question: "能独立完成仰卧、侧卧、俯卧的体位变化吗",
                img: "",
                type: "turnOverScore"},
            {question: "能保持独立坐5分钟吗",
                img: "",
                type: "sitScore"},
            {question: "全脚掌着地站立1分钟能独立完成吗",
                img: "",
                type: "standScore"},
            {question: "在床、轮椅、椅子、便器等之间的移动能独立完成吗",
                img: "",
                type: "transferScore"},
            {question: "在平地连续走20单步或驱动轮椅50米能独立完成吗",
                img: "",
                type: "moveScore"},
            {question: "连续上下12级高约15厘米的台阶可以独立完成吗",
                img: "",
                type: "upAndDownStairsScore"},
            {question: "能独立将食物送入口中并完成进食吗",
                img: "",
                type: "eatScore"},
            {question: "能独立穿脱衣物吗",
                img: "",
                type: "wearScore"},
            {question: "能独立完成洗脸、刷牙、梳头中的任意一项吗",
                img: "",
                type: "bathScore"},
            {question: "能独立使用便器并进行便后清洁吗",
                img: "",
                type: "toiletUsingScore"},
            {question: "在言语、手势、文字和图示上的理解与表达能力如何",
                img: "",
                type: "communicationScore"},
            {question: "能独立从事日常家务劳动的任意一种吗",
                img: "",
                type: "houseworkScore"},
            {question: "上学、劳动或外出活动能独立完成吗",
                img: "",
                type: "activityScore"},
        ],
        thisQuestion: '',
        thisQuestionFlag: -1,
        
        onLoad: function () {
            this.setData({
                thisQuestionFlag: 0
            })
        },
        finish(event) {
            console.log(app.globalData)
            app.globalData.scores[this.data.questionList[this.data.thisQuestionFlag].type] = parseInt(event.target.dataset.score)
            if(this.data.thisQuestionFlag <12 ){
                this.setData({
                    thisQuestionFlag: this.data.thisQuestionFlag + 1
                })
            }else{
                app.globalData.plan = {
                    "groupTimes": "每组重复5-7次",
                    "livingAdaptTarget": "提高生活适应能力",
                    "recureMethods": [
                        "理疗辅助",
                        "使用辅助器具",
                        "中医疗法",
                        "被动运动疗法"
                    ],
                    "selfLivingTarget": "独立外出",
                    "sportTarget": "可以自己行走",
                    "strength": "训练频度至少每周2-3组，最好每天1-2组",
                    "trainingProjects": [
                        "翻身",
                        "坐",
                        "站",
                        "转移",
                        "上下台阶",
                        "交流"
                    ]
                }
                wx.switchTab({
                  url: '../recurePlan/recurePlan',
                })
            }
            
        },
        toLast(){
            if(this.data.thisQuestionFlag > 0)
                this.setData({
                    thisQuestionFlag: this.data.thisQuestionFlag - 1
                })
            console.log("toLast")
        },
        toNext(){
            if(this.data.thisQuestionFlag < 12)
                this.setData({
                    thisQuestionFlag: this.data.thisQuestionFlag + 1
                })
            console.log("toNext")
        },



})

